package com.spotalog.server.service.rest.exceptions;

import javax.inject.Singleton;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;

import com.spotalog.shared.exceptions.NotFoundException;

@Provider
@Singleton
public class NotFoundExceptionMapper implements
		ExceptionMapper<NotFoundException> {
	@Override
	public Response toResponse(NotFoundException exception) {
		return Response.status(Response.Status.NOT_FOUND)
				.entity(exception.getLocalizedMessage()).build();
	}
}
